package org.example;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TraceLogger {
    //此处的"tranceLog"为log4j中定义的对应的 logger的name
//    private static final Logger traceLogger = LoggerFactory.getLogger("traceLogScy");

    static final Logger traceLogger = LoggerFactory.getLogger(org.example.TraceLogger.class);

//    private static final Logger traceLogger = LoggerFactory.getLogger("org.example");

    private TraceLogger() {

    }

    public static void debug(String message) {

        if (traceLogger.isDebugEnabled()) {
            traceLogger.debug(message);
        } else {
            System.out.println("系统未开启debug[DEBUG] " + message);
        }

    }

    public static void info(String message) {
        traceLogger.info(message);
    }

    public static void error(String message, Throwable throwable) {
        traceLogger.error(message, throwable);
    }

    public static void info(String format, Object... arguments) {
        traceLogger.info(format, arguments);
    }
}